﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using StarsAdmin.Core.DB.Entities;

namespace StarsAdmin.Core.DB.Configs
{
    public class FileConfig : IEntityTypeConfiguration<FileEntity>
    {
        public void Configure(EntityTypeBuilder<FileEntity> builder)
        {
            builder.ToTable("T_Files");
            builder.Property(p => p.FileName).IsRequired().HasMaxLength(64);
            builder.Property(p => p.SaveFileName).IsRequired().HasMaxLength(256);
            builder.Property(p => p.Extension).IsRequired().HasMaxLength(64);
            builder.Property(p => p.Type).IsRequired().HasMaxLength(128);
            builder.Property(p => p.FileDirectory).IsRequired().HasMaxLength(64);
            builder.Property(p => p.Url).HasMaxLength(256);
            builder.Property(p => p.SizeFormat).HasMaxLength(256);
            builder.Property(p => p.Md5).HasMaxLength(256);
        }
    }
}